//
//  _iOSUtils_Addtions.h
//  iOSUtils
//
//  Created by HJC on 11-9-9.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>


/////////////////////////////
@interface UIColor(_iOSUtils_Addtions)

// 将photoshop中的颜色字符串转成UIColor, 比如 #00FFFF
+ (UIColor*)        colorFromString:(NSString*)string;

@end



/////////////////////////////////
@interface NSDictionary(_iOSUtils_Addtions)

// 将data转成字典
+ (NSDictionary *)dictionaryWithContentsOfData:(NSData *)data;

@end



//////////////////////////////
@interface NSMutableArray(_iOSUtils_Addtions)

// 将object从索引号为atIndex移动到toIndex
- (void) moveObjectAtIndex:(NSInteger)atIndex toIndex:(NSInteger)toIndex;

// 将数组反转
- (void) reverse;

@end



/////////////////////////////
typedef struct
{
    NSString*   refPath;
    NSString*   basePath;
    BOOL        isDirectory;
} TraversePathInfo;


typedef enum
{
    TraverseRetureType_Continue,
    TraverseRetureType_IgnoreThisDirectory,
    TraverseRetureType_StopTraverseAll,
} TraverseRetureType;


typedef TraverseRetureType (*TraversePathCallBackType)(TraversePathInfo pathInfo, void* context); 


@interface NSFileManager(_iOSUtils_Addtions)

// 应用程序文档目录
+ (NSString*) documentPath;

// 资源目录
+ (NSString*) resourcePath;

// 如果filePath目录不存在, 就创建此目录, 失败返回FALSE
+ (BOOL) letDirectoryExistsAtPath:(NSString*)filePath;

// 遍历目录
+ (void) traversePath:(NSString*)path 
            recursive:(BOOL)recursive
             callBack:(TraversePathCallBackType)callBack
              context:(void*)context;


@end

